package com.uminho.objects;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.GregorianCalendar;

/****c* Objects/Appointment
* DESCRIPTION
* Objeto que representa um compromisso. É portanto utilizado para armazenar informações como o serviço associado, o identificador, um comentário, a data e hora de início e conclusão prevista e ainda as listas de recursos, tarefas e clientes associados.
****
*/

public class Appointment implements Serializable{
	private static final long serialVersionUID = -7152559453344794744L;

	SimpleService service;
	Long id;
	GregorianCalendar startDate, endDate;
	String Comment;
	ArrayList<Resource> resources;
	ArrayList<Task> tasks;
	ArrayList<AppClient> users;
	
	Boolean canceled;
	

	public Appointment(SimpleService service, GregorianCalendar startDate,
			GregorianCalendar endDate, String comment,
			ArrayList<Resource> resources, ArrayList<Task> tasks,
			ArrayList<AppClient> users) {
		this.service = service;
		this.startDate = startDate;
		this.endDate = endDate;
		this.Comment = comment;
		this.resources = resources;
		this.tasks = tasks;
		this.users = users;
		canceled = false;
	}
	
	public Appointment(GregorianCalendar startDate, GregorianCalendar endDate) {
		this.startDate = startDate;
		this.endDate = endDate;
		canceled = false;
	}
	
	public Appointment(Long id, SimpleService service, GregorianCalendar startDate,
			GregorianCalendar endDate, String comment,
			ArrayList<Resource> resources, ArrayList<Task> tasks,
			ArrayList<AppClient> users) {
		this.id = id;
		this.service = service;
		this.startDate = startDate;
		this.endDate = endDate;
		this.Comment = comment;
		this.resources = resources;
		this.tasks = tasks;
		this.users = users;
		this.id = id;
		canceled = false;
	}

	public SimpleService getService() {
		return service;
	}

	public void setService(SimpleService service) {
		this.service = service;
	}
	
	public void setService(String id, String name) {
		SimpleService s = new SimpleService();
		s.setServiceId(id);
		s.setTitle(name);
		this.service = s;
	}

	public GregorianCalendar getStartDate() {
		return startDate;
	}

	public void setStartDate(GregorianCalendar startDate) {
		this.startDate = startDate;
	}

	public GregorianCalendar getEndDate() {
		return endDate;
	}

	public void setEndDate(GregorianCalendar endDate) {
		this.endDate = endDate;
	}

	public String getComment() {
		return Comment;
	}

	public void setComment(String comment) {
		Comment = comment;
	}

	public ArrayList<Resource> getResources() {
		return resources;
	}

	public void setResources(ArrayList<Resource> resources) {
		this.resources = resources;
	}

	public ArrayList<Task> getTasks() {
		return tasks;
	}

	public void setTasks(ArrayList<Task> tasks) {
		this.tasks = tasks;
	}

	public ArrayList<AppClient> getUsers() {
		return users;
	}

	public void setUsers(ArrayList<AppClient> users) {
		this.users = users;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public void setCanceled(){
		this.canceled = true;
	}
	
	public Boolean isCanceled(){
		return this.canceled;
	}
}